package com.langsotech.studio.project.wizard.project;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class GuiHelper {
	public static Composite createSwordComp(Composite parent, int style,
			GridData gd, GridLayout layout) {
		Composite comp = new Composite(parent, style);
		if (layout != null)
			comp.setLayout(layout);
		if (gd != null)
			comp.setLayoutData(gd);
		return comp;
	}
	public static Text createSwordText(Composite parent, int style, GridData gd) {
		Text swordtext = new Text(parent, style);
		if (gd != null)
			swordtext.setLayoutData(gd);
		return swordtext;
	}
	public static void createSwordLabel(Composite parent, int style, String text) {
		Label swordlabel = new Label(parent, style);
		if (text != null)
			swordlabel.setText(text);
	}
	public static Combo createSwordCombo(Composite parent, int style,
			GridData gd, GridLayout layout) {
		Combo swordcombo = new Combo(parent, style);
		if (layout != null)
			swordcombo.setLayout(layout);
		if (gd != null)
			swordcombo.setLayoutData(gd);
		return swordcombo;
	}
	public static Button createSwordButton(Composite parent, int style,
			String text, GridData gd) {
		Button swordbutton = new Button(parent, style);
		if (text != null)
			swordbutton.setText(text);
		if (gd != null)
			swordbutton.setLayoutData(gd);
		return swordbutton;
	}
	public static SashForm createSwordSashForm(Composite parent, int style,
			Point size, GridData gd, GridLayout layout) {
		SashForm swordsash = new SashForm(parent, style);
		if (layout != null)
			swordsash.setLayout(layout);
		if (gd != null)
			swordsash.setLayoutData(gd);
		if (size != null)
			swordsash.setSize(size);
		return swordsash;
	}
	public static Group createSwordGroup(Composite parent, int style,
			GridData gd, GridLayout layout, String text) {
		Group swordGroup = new Group(parent, style);
		if (layout != null)
			swordGroup.setLayout(layout);
		if (gd != null)
			swordGroup.setLayoutData(gd);
		if (text != null)
			swordGroup.setText(text);
		return swordGroup;
	}
	protected static GridData gdhfill() {
		return new GridData(768);
	}
}
